/**
 * Bestpay.com.cn Inc.
 * Copyright (c) 2011-2017 All Rights Reserved.
 */
package com.sgzn.sgpay.integration.service.base;

import com.sgzn.sgpay.model.request.able.SgsReqAble;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 路由分发
 * @author zhongzhongyong
 * @version Id: TradeRouter.java, v 0.1 2018/4/5 14:38 zhongzhongyong Exp $$
 */
@Service
public class TradeRouter {

    /**
     * 路由分发
     * @param request
     * @return
     */
    public String routeToTrans(SgsReqAble request) {
        String trsName = request.getClass().getSimpleName();
        String channelName = trsName.substring(3, trsName.length() - 7) + "Channel";
        channelName = StringUtils.uncapitalize(channelName);
        return channelName;
    }

}
